package org.apache.commons.graph.visitor

import com.gitee.wsl.func.consumer.Consumer


interface ISourceVertexVisitor<V> {
    fun getSourceVertexes(vertex: V): List<V>

    fun forEachSource(vertex: V, action: Consumer<in V>) {
        val list = getSourceVertexes(vertex)
        for (source in list) {
            action.accept(source)
        }
    }
}